﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Home.Master" Inherits="System.Web.Mvc.ViewPage<VideoListViewModel>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%@ Import Namespace="SDT.Lib.Paging" %>
<%@ Import Namespace="SDT.Site.ViewModels" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%=Model.Category != null ? Model.Category.Name : "Video, bất động sản."%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <form action="/video/Category" method="post" name="artcleForm">
    <div class="content-new">
        <div class="componentheading">
            <h2>
                TAG:
                <%= ViewData["Keyword"]%></h2>
        </div>
        <div id="list-cate">
            <div class="pad">
                <%var first = Model.Videos != null && Model.Videos.Count > 0 ? Model.Videos[0] : null;
                  if (first != null)
                  {%>
                <div class="item-cate-first">
                    <div class="list-bor">
                        <div class="img-first">
                            <a href="/video/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Name)%>">
                                <% string imgPath = (first.ImagePath != null && first.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(first.ID, 214, 150, first.ImagePath, Model.VideoImagePath, Model.VideoImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                                <img src="<%=imgPath %>" title="<%=first.Name %>" alt="<%=first.Name %>" />
                            </a>
                        </div>
                        <div class="art-content">
                            <div class="title-less-top">
                                <h3>
                                    <a href="/video/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Name)%>">
                                        <%=first.Name %></a>
                                </h3>
                            </div>
                            <div class="date date-first">
                                <%=first.AddDate.HasValue ? (first.AddDate.Value.ToString("hh:mm") + "&nbsp;|&nbsp;" + first.AddDate.Value.ToString("dd/MM/yyyy")) : string.Empty%>
                                &nbsp;(&nbsp;<%= first.nViews%>
                                lượt xem&nbsp;)
                            </div>
                            <div class="lead">
                                <%=first.Description%>
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                    </div>
                </div>
                <%} %>
                <%if (Model.Videos.Count > 1)
                  {
                      for (int i = 1; i < Model.Videos.Count; i++)
                      { %>
                <div class="item-cate">
                    <div class="list-bor">
                        <div class="avatar">
                            <a href="/video/details/<%=Model.Videos[i].ID %>/<%=Html.ToUrlFriendly(Model.Videos[i].Name)%>">
                                <% string imgPath = (Model.Videos[i].ImagePath != null && Model.Videos[i].ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(Model.Videos[i].ID, 130, 100, Model.Videos[i].ImagePath, Model.VideoImagePath, Model.VideoImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                                <img style="height: 100px; width: 130px" src="<%=imgPath %>" title="<%=Model.Videos[i].Name %>"
                                    alt="<%=Model.Videos[i].Name %>" />
                            </a>
                        </div>
                        <div class="art-content">
                            <div class="title-less">
                                <h3>
                                    <a href="/video/details/<%=Model.Videos[i].ID %>/<%=Html.ToUrlFriendly(Model.Videos[i].Name)%>">
                                        <%=Model.Videos[i].Name%></a></h3>
                            </div>
                            <div class="date date-first">
                                <%=Model.Videos[i].AddDate.HasValue ? (Model.Videos[i].AddDate.Value.ToString("hh:mm") + "&nbsp;|&nbsp;" + Model.Videos[i].AddDate.Value.ToString("dd/MM/yyyy")) : string.Empty%>
                                &nbsp;(&nbsp;<%= Model.Videos[i].nViews %>
                                lượt xem&nbsp;)
                            </div>
                            <div class="lead">
                                <%=Model.Videos[i].Description.Length < 350 ? Model.Videos[i].Description : Model.Videos[i].Description.Substring(0, 350) + "..."%>
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                    </div>
                </div>
                <%}
                  } %>
            </div>
        </div>
    </div>
    <div class="pagebarUTH f_r">
        Trang
        <%= Model.Videos.PageNumber%>/<%= Model.Videos.PageCount%>
        <%= Html.Pager(Model.Videos.PageSize, Model.Videos.PageNumber, Model.Videos.TotalItemCount)%>
    </div>
    </form>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContent" runat="server">
   <% Html.RenderAction("Lasted", "Video", new { catid = Model.Category!=null? Model.Category.ID:0, number = 3, title = Model.Category!=null? Model.Category.Name:string.Empty }); %>
    <div class="clear"></div>
    <% Html.RenderAction("Focus", "Article", new { number = 5, skip = 0, catid = SDT.Model.ConfigManager.GetArticle(), title = "Thị trường bất động sản", order = "ID", orderDir = "desc" }); %>
<%--    <div class="clear"></div>
    <% Html.RenderAction("Lasted", "Useful", new { number = 9 }); %>--%>
    <div class="clear"></div>
    <% Html.RenderAction("Lasted", "Event", new { number = 3, catid = Model.Category != null ? Model.Category.ID : 0 }); %>
    <div class="clear"></div>     
   <% Html.RenderAction("Focus", "company", new { number = 5, skip = 0, catid = SDT.Model.ConfigManager.GetTindoanhnghiep(), title = "Tin doanh nghiệp", order = "ID", orderDir = "desc" }); %>
    <div class="clear"></div>
</asp:Content>
